package com.xiangmo.travel.Result;

public enum ErrorCode {

    SUCCESS(200, "成功"),
    FAILED(500, "失败"),

    //auth
    FORBIDDEN(1000, "未登录，禁止访问"),
    PASSWORDERROR(1001, "密码错误"),
    ACCOUNT_DISABLE(1002, "账户被禁用"),
    TOKEN_EXPIRE(1003, "Token 过期"),
    TOKEN_ERROR(1004, "token错误"),
    LOGIN_FREQUENT(1005, "登录过于频繁"),


    RUNTIME_EXCEPTION(2000, "运行时异常"),

    BUSSINESS_EXCEPTION(3000, "业务异常"),

    UNKNOW_EXCEPTION(10000, "未知异常"),

    PARAM_ERROR(10001, "参数错误"),
    ALREADY_EXIST(10002, "记录已经存在！"),
    CONTENT_ALREADY_EXIST(10003, "content内容重复，请修改！"),
    NOT_CONFIG(10004, "内容未配置，请检查！"),
    PARAM_EMPTY(10005, "参数不能为空，请检查！"),
    SYS_ERROR(10006, "登录状态异常"),
    UPFILE_NO_Find(10007, "获取不到上传文件"),
    FILE_READ_ERROR(10008, "文件存储失败"),
    UpLOADING_IS_NOT_ALLOWED(10009, "上传不被允许"),
    DATE_CEILING(10010, "超过上限"),
    CODE_ERROR(10011, "验证码错误"),
    SYSTEM_IS_BUSY(10012, "系统繁忙"),
    UNBOUND_USER(10013, "此号码暂没有匹配用户，请换一个试试看哦");


    private String errorMsg;

    private int errorCode;

    ErrorCode(int errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public String getErrorCodeStr() {
        return String.valueOf(errorCode);
    }


}
